package ar.com.quickMart.webservices;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import ar.com.quickMart.logic.Branch;
import ar.com.quickMart.logic.ComparedPrices;
import ar.com.quickMart.logic.ConfirmedQuickMartList;
import ar.com.quickMart.logic.HistoryList;
import ar.com.quickMart.logic.Product;
import ar.com.quickMart.logic.Promotion;
import ar.com.quickMart.logic.Purchasable;
import ar.com.quickMart.logic.QuickMartList;
import ar.com.quickMart.logic.SuperMarket;
import ar.com.quickMart.webservices.dto.statistics.SimpleXYCompareDto;

/**
 * 
 * Interfaz que contiene la declaracion de los webservices a
 * desarrollar para la aplicacion Android para los usuarios
 * Es una puesta en comun acerca de los nombres a utilizar
 * 
 * @author Fabio trola
 *
 */

@WebService
public interface WebServiceMethodsAndroidApp {
		
	@WebMethod
	public boolean checkUserLogin(@WebParam(name="user") String user, @WebParam(name="password") String password);

	@WebMethod
	public boolean addUser(@WebParam(name="name") String name,@WebParam(name="mail") String mail,@WebParam(name="pass") String pass);

	@WebMethod
	public String getProductName(long barCode);
	
	@WebMethod
	public List<String> getListsNames(@WebParam(name="userName") String userName);
	
	@WebMethod
	public List<Purchasable> getListItems(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName);
	
	@WebMethod
	public boolean addProductToList(@WebParam(name="userName") String userName, 
			@WebParam(name="listName") String listName, 
			@WebParam(name="barCode") long barcode,
			@WebParam(name="count") int count);
	
	@WebMethod
	public boolean removeProductFromList(@WebParam(name="userName") String userName, 
			@WebParam(name="listName") String listName, 
			@WebParam(name="barCode") long barcode);
	
	@WebMethod
	public boolean addPromotionToList(@WebParam(name="userName") String userName, 
			@WebParam(name="listName") String listName, 
			@WebParam(name="code") long code,
			@WebParam(name="count") int count);
	
	@WebMethod
	public boolean removePromotionFromList(@WebParam(name="userName") String userName, 
			@WebParam(name="listName") String listName, 
			@WebParam(name="code") long code);
	
	@WebMethod
	public boolean createList(@WebParam(name="userName") String userName,
							  @WebParam(name="listName") String listName);
	
	@WebMethod
	public boolean removeList(@WebParam(name="userName") String userName,
			@WebParam(name="listName") String listName);
	
	@WebMethod
	public List<SuperMarket> getSuperMarketList();
	
	@WebMethod
	public List<Branch> getBranchList(@WebParam(name="supermarketId") long supermarketId);
	
	@WebMethod
	public boolean asociateListToSuper(@WebParam(name = "userName") String userName, @WebParam(name="listName") String listName, @WebParam(name="branchId")long branchId);
	
	@WebMethod
	public Branch getListBranch(@WebParam(name = "userName") String userName, @WebParam(name="listName") String listName);
	
	@WebMethod
	public QuickMartList getQuickMartList(@WebParam(name = "userName") String userName, @WebParam(name="listName") String listName);


	@WebMethod
	public List<HistoryList> getHistoryLists(@WebParam(name = "userName") String userName);
	
	@WebMethod
	public List<Purchasable> getHistoryListItems(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName);
	
	@WebMethod
	public boolean changeListName(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName, @WebParam(name="newListName") String newListName);
	
	@WebMethod
	public boolean changeCount(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName, @WebParam(name="code") long code, @WebParam(name="count") int count);
	
	
	@WebMethod
	public List<Product> getPromotionProducts(@WebParam(name="promotionId") long promotionId);
	
	@WebMethod
	public boolean cloneList(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName, @WebParam(name="newListName") String newListName);

	@WebMethod
	public boolean purchaseList(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName);

	@WebMethod
	public List<ComparedPrices> comparePrices(@WebParam(name="userName") String userName, @WebParam(name="listName") String listName);
	
	@WebMethod
	public List<QuickMartList> getQuickMartLists(@WebParam(name="userName") String userName, @WebParam(name="reqSuperMarketAsociated") boolean reqSuperMarketAsociated);

	
	@WebMethod
	public Promotion getPromotionInfo(@WebParam(name="code") long code);
	
	@WebMethod
	public String getStatisticsAcumPurchasedInMonth(@WebParam(name = "userName") String userName,@WebParam(name = "month") int month,@WebParam(name = "year") int year);
	
}
